package org.example.advice;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class LogAdvice {
    @Before("org.example.pointCut.MyPointCut.pc()")
    public void start(){
        System.out.println("start");
    }
    @After("org.example.pointCut.MyPointCut.pc()")
    public void end(){
        System.out.println("end");
    }
    @AfterThrowing("org.example.pointCut.MyPointCut.pc()")
    public void error(){
        System.out.println("error");
    }
}
